1. Field of the Invention
The present invention relates to a method for data calculation. More particularly, the present invention relates to a method for assisting in data calculation by using a display card.
2. Description of Related Art
A central processing unit (CPU) is a main tool of a computer for executing calculations. Besides the CPU, to meet an increasing demand of drawing, a display card disposed on a motherboard is generally equipped with an independent graphic processing unit (GPU) and a display memory, so as to accelerate a drawing speed. During drawing of the display card, texture data is first obtained to execute a texture-related calculation, and then a calculation result is displayed on a target.
In detail, FIG. 1 is a flowchart illustrating a conventional drawing method by using a display card. FIG. 2 is a schematic diagram illustrating a conventional drawing method by using a display card. Referring to FIG. 1 and FIG. 2, textures used for drawing are set first (step S110), in which the textures can be an image or a pattern, for example, the textures 210 and 220 of FIG. 2. Next, a texture calculation to be executed is set (step S120). The texture calculation may be executed via a program written with pixel shader codes, for example, the texture calculation 230 of FIG. 2. Next, an output target of the calculation is set (step S130), for example, the target 240 shown in FIG. 2. The aforementioned set textures or target can be respectively regarded as a part of a display memory, and range definitions of the textures and the target required for the texture calculation have to be set before the texture calculation (step S140). During the texture calculation, the GPU of the display card obtains a pixel value of a certain pixel from the textures for texture calculation, and then outputs a calculation result to a corresponding pixel on the target (step S150).
With the development of technology, data required to be processed by the computer is greatly increased, to meet such a demand, it seems to have no other solutions besides applying a high-efficiency CPU. However, as described above, the GPU of the display card actually has a powerful calculation capability, and if such calculation capability can be appropriately utilized during an idle time thereof, a part of calculation tasks of the CPU can be shared by the GPU so as to reduce a usage rate of the CPU, which is come to an idea of the present invention.